3.296 \(\int (g+h x) (A+B \log (e (a+b x)^n (c+d x)^{-n})) \, dx\)

Optimal. Leaf size=116 \[ \frac{(g+h x)^2 \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )}{2 h}-\frac{B n (b g-a h)^2 \log (a+b x)}{2 b^2 h}-\frac{B h n x (b c-a d)}{2 b d}+\frac{B n (d g-c h)^2 \log (c+d x)}{2 d^2 h} \]

[Out]

-(B*(b*c - a*d)*h*n*x)/(2*b*d) - (B*(b*g - a*h)^2*n*Log[a + b*x])/(2*b^2*h) + (B*(d*g - c*h)^2*n*Log[c + d*x])
/(2*d^2*h) + ((g + h*x)^2*(A + B*Log[(e*(a + b*x)^n)/(c + d*x)^n]))/(2*h)

________________________________________________________________________________________

Rubi [A]  time = 0.148869, antiderivative size = 128, normalized size of antiderivative = 1.1, number of steps used = 5, number of rules used = 3, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.103, Rules used = {6742, 2492, 72} \[ -\frac{B n (b g-a h)^2 \log (a+b x)}{2 b^2 h}+\frac{B (g+h x)^2 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{2 h}-\frac{B h n x (b c-a d)}{2 b d}+\frac{A (g+h x)^2}{2 h}+\frac{B n (d g-c h)^2 \log (c+d x)}{2 d^2 h} \]

Antiderivative was successfully verified.

[In]

Int[(g + h*x)*(A + B*Log[(e*(a + b*x)^n)/(c + d*x)^n]),x]

[Out]

-(B*(b*c - a*d)*h*n*x)/(2*b*d) + (A*(g + h*x)^2)/(2*h) - (B*(b*g - a*h)^2*n*Log[a + b*x])/(2*b^2*h) + (B*(d*g
- c*h)^2*n*Log[c + d*x])/(2*d^2*h) + (B*(g + h*x)^2*Log[(e*(a + b*x)^n)/(c + d*x)^n])/(2*h)

Rule 6742

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rule 2492

Int[Log[(e_.)*((f_.)*((a_.) + (b_.)*(x_))^(p_.)*((c_.) + (d_.)*(x_))^(q_.))^(r_.)]^(s_.)*((g_.) + (h_.)*(x_))^
(m_.), x_Symbol] :> Simp[((g + h*x)^(m + 1)*Log[e*(f*(a + b*x)^p*(c + d*x)^q)^r]^s)/(h*(m + 1)), x] - Dist[(p*
r*s*(b*c - a*d))/(h*(m + 1)), Int[((g + h*x)^(m + 1)*Log[e*(f*(a + b*x)^p*(c + d*x)^q)^r]^(s - 1))/((a + b*x)*
(c + d*x)), x], x] /; FreeQ[{a, b, c, d, e, f, g, h, m, p, q, r, s}, x] && NeQ[b*c - a*d, 0] && EqQ[p + q, 0]
&& IGtQ[s, 0] && NeQ[m, -1]

Rule 72

Int[((e_.) + (f_.)*(x_))^(p_.)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Int[ExpandIntegrand[(
e + f*x)^p/((a + b*x)*(c + d*x)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IntegerQ[p]

Rubi steps

\begin{align*} \int (g+h x) \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx &=\int \left (A (g+h x)+B (g+h x) \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx\\ &=\frac{A (g+h x)^2}{2 h}+B \int (g+h x) \log \left (e (a+b x)^n (c+d x)^{-n}\right ) \, dx\\ &=\frac{A (g+h x)^2}{2 h}+\frac{B (g+h x)^2 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{2 h}-\frac{(B (b c-a d) n) \int \frac{(g+h x)^2}{(a+b x) (c+d x)} \, dx}{2 h}\\ &=\frac{A (g+h x)^2}{2 h}+\frac{B (g+h x)^2 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{2 h}-\frac{(B (b c-a d) n) \int \left (\frac{h^2}{b d}+\frac{(b g-a h)^2}{b (b c-a d) (a+b x)}+\frac{(d g-c h)^2}{d (-b c+a d) (c+d x)}\right ) \, dx}{2 h}\\ &=-\frac{B (b c-a d) h n x}{2 b d}+\frac{A (g+h x)^2}{2 h}-\frac{B (b g-a h)^2 n \log (a+b x)}{2 b^2 h}+\frac{B (d g-c h)^2 n \log (c+d x)}{2 d^2 h}+\frac{B (g+h x)^2 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{2 h}\\ \end{align*}

Mathematica [A]  time = 0.167751, size = 124, normalized size = 1.07 \[ \frac{-a^2 B d^2 h n \log (a+b x)+b d \left (x (B h n (a d-b c)+A b d (2 g+h x))+B d (2 a g+b x (2 g+h x)) \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )+b B n \log (c+d x) \left (2 a d^2 g+b c (c h-2 d g)\right )}{2 b^2 d^2} \]

Antiderivative was successfully verified.

[In]

Integrate[(g + h*x)*(A + B*Log[(e*(a + b*x)^n)/(c + d*x)^n]),x]

[Out]

(-(a^2*B*d^2*h*n*Log[a + b*x]) + b*B*(2*a*d^2*g + b*c*(-2*d*g + c*h))*n*Log[c + d*x] + b*d*(x*(B*(-(b*c) + a*d
)*h*n + A*b*d*(2*g + h*x)) + B*d*(2*a*g + b*x*(2*g + h*x))*Log[(e*(a + b*x)^n)/(c + d*x)^n]))/(2*b^2*d^2)

________________________________________________________________________________________

Maple [C]  time = 0.541, size = 839, normalized size = 7.2 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((h*x+g)*(A+B*ln(e*(b*x+a)^n/((d*x+c)^n))),x)

[Out]

1/2*A*h*x^2+A*g*x+1/2*B*h*x^2*ln((b*x+a)^n)-1/2*B*x*(h*x+2*g)*ln((d*x+c)^n)+B*g*x*ln((b*x+a)^n)+1/2*B*ln(e)*h*
x^2+B*ln(e)*g*x-1/2*I*B*Pi*g*x*csgn(I*(b*x+a)^n/((d*x+c)^n))^3-1/2*I*B*Pi*g*x*csgn(I*e/((d*x+c)^n)*(b*x+a)^n)^
3+1/2*I*B*Pi*g*x*csgn(I*(b*x+a)^n)*csgn(I*(b*x+a)^n/((d*x+c)^n))^2+1/2*I*B*Pi*g*x*csgn(I*(b*x+a)^n/((d*x+c)^n)
)*csgn(I*e/((d*x+c)^n)*(b*x+a)^n)^2+1/2*I*B*Pi*g*x*csgn(I*e)*csgn(I*e/((d*x+c)^n)*(b*x+a)^n)^2-1/2/b^2*B*ln(b*
x+a)*a^2*h*n+1/b*B*ln(b*x+a)*a*g*n+1/2/d^2*B*ln(-d*x-c)*c^2*h*n-1/d*B*ln(-d*x-c)*c*g*n-1/4*I*B*Pi*h*x^2*csgn(I
*(b*x+a)^n/((d*x+c)^n))^3-1/4*I*B*Pi*h*x^2*csgn(I*e/((d*x+c)^n)*(b*x+a)^n)^3-1/4*I*B*Pi*h*x^2*csgn(I*(b*x+a)^n
)*csgn(I/((d*x+c)^n))*csgn(I*(b*x+a)^n/((d*x+c)^n))-1/4*I*B*Pi*h*x^2*csgn(I*e)*csgn(I*(b*x+a)^n/((d*x+c)^n))*c
sgn(I*e/((d*x+c)^n)*(b*x+a)^n)-1/2*I*B*Pi*g*x*csgn(I*(b*x+a)^n)*csgn(I/((d*x+c)^n))*csgn(I*(b*x+a)^n/((d*x+c)^
n))-1/2*I*B*Pi*g*x*csgn(I*e)*csgn(I*(b*x+a)^n/((d*x+c)^n))*csgn(I*e/((d*x+c)^n)*(b*x+a)^n)+1/2/b*B*a*h*n*x-1/2
/d*B*c*h*n*x+1/4*I*B*Pi*h*x^2*csgn(I/((d*x+c)^n))*csgn(I*(b*x+a)^n/((d*x+c)^n))^2+1/4*I*B*Pi*h*x^2*csgn(I*(b*x
+a)^n)*csgn(I*(b*x+a)^n/((d*x+c)^n))^2+1/4*I*B*Pi*h*x^2*csgn(I*(b*x+a)^n/((d*x+c)^n))*csgn(I*e/((d*x+c)^n)*(b*
x+a)^n)^2+1/4*I*B*Pi*h*x^2*csgn(I*e)*csgn(I*e/((d*x+c)^n)*(b*x+a)^n)^2+1/2*I*B*Pi*g*x*csgn(I/((d*x+c)^n))*csgn
(I*(b*x+a)^n/((d*x+c)^n))^2

________________________________________________________________________________________

Maxima [A]  time = 1.16413, size = 208, normalized size = 1.79 \begin{align*} \frac{1}{2} \, B h x^{2} \log \left (\frac{{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + \frac{1}{2} \, A h x^{2} + B g x \log \left (\frac{{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A g x + \frac{{\left (\frac{a e n \log \left (b x + a\right )}{b} - \frac{c e n \log \left (d x + c\right )}{d}\right )} B g}{e} - \frac{{\left (\frac{a^{2} e n \log \left (b x + a\right )}{b^{2}} - \frac{c^{2} e n \log \left (d x + c\right )}{d^{2}} + \frac{{\left (b c e n - a d e n\right )} x}{b d}\right )} B h}{2 \, e} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)*(A+B*log(e*(b*x+a)^n/((d*x+c)^n))),x, algorithm="maxima")

[Out]

1/2*B*h*x^2*log((b*x + a)^n*e/(d*x + c)^n) + 1/2*A*h*x^2 + B*g*x*log((b*x + a)^n*e/(d*x + c)^n) + A*g*x + (a*e
*n*log(b*x + a)/b - c*e*n*log(d*x + c)/d)*B*g/e - 1/2*(a^2*e*n*log(b*x + a)/b^2 - c^2*e*n*log(d*x + c)/d^2 + (
b*c*e*n - a*d*e*n)*x/(b*d))*B*h/e

________________________________________________________________________________________

Fricas [A]  time = 1.01071, size = 413, normalized size = 3.56 \begin{align*} \frac{A b^{2} d^{2} h x^{2} +{\left (2 \, A b^{2} d^{2} g -{\left (B b^{2} c d - B a b d^{2}\right )} h n\right )} x +{\left (B b^{2} d^{2} h n x^{2} + 2 \, B b^{2} d^{2} g n x +{\left (2 \, B a b d^{2} g - B a^{2} d^{2} h\right )} n\right )} \log \left (b x + a\right ) -{\left (B b^{2} d^{2} h n x^{2} + 2 \, B b^{2} d^{2} g n x +{\left (2 \, B b^{2} c d g - B b^{2} c^{2} h\right )} n\right )} \log \left (d x + c\right ) +{\left (B b^{2} d^{2} h x^{2} + 2 \, B b^{2} d^{2} g x\right )} \log \left (e\right )}{2 \, b^{2} d^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)*(A+B*log(e*(b*x+a)^n/((d*x+c)^n))),x, algorithm="fricas")

[Out]

1/2*(A*b^2*d^2*h*x^2 + (2*A*b^2*d^2*g - (B*b^2*c*d - B*a*b*d^2)*h*n)*x + (B*b^2*d^2*h*n*x^2 + 2*B*b^2*d^2*g*n*
x + (2*B*a*b*d^2*g - B*a^2*d^2*h)*n)*log(b*x + a) - (B*b^2*d^2*h*n*x^2 + 2*B*b^2*d^2*g*n*x + (2*B*b^2*c*d*g -
B*b^2*c^2*h)*n)*log(d*x + c) + (B*b^2*d^2*h*x^2 + 2*B*b^2*d^2*g*x)*log(e))/(b^2*d^2)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)*(A+B*ln(e*(b*x+a)**n/((d*x+c)**n))),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 5.78446, size = 201, normalized size = 1.73 \begin{align*} \frac{1}{2} \,{\left (A h + B h\right )} x^{2} + \frac{1}{2} \,{\left (B h n x^{2} + 2 \, B g n x\right )} \log \left (b x + a\right ) - \frac{1}{2} \,{\left (B h n x^{2} + 2 \, B g n x\right )} \log \left (d x + c\right ) - \frac{{\left (B b c h n - B a d h n - 2 \, A b d g - 2 \, B b d g\right )} x}{2 \, b d} + \frac{{\left (2 \, B a b g n - B a^{2} h n\right )} \log \left (b x + a\right )}{2 \, b^{2}} - \frac{{\left (2 \, B c d g n - B c^{2} h n\right )} \log \left (-d x - c\right )}{2 \, d^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)*(A+B*log(e*(b*x+a)^n/((d*x+c)^n))),x, algorithm="giac")

[Out]

1/2*(A*h + B*h)*x^2 + 1/2*(B*h*n*x^2 + 2*B*g*n*x)*log(b*x + a) - 1/2*(B*h*n*x^2 + 2*B*g*n*x)*log(d*x + c) - 1/
2*(B*b*c*h*n - B*a*d*h*n - 2*A*b*d*g - 2*B*b*d*g)*x/(b*d) + 1/2*(2*B*a*b*g*n - B*a^2*h*n)*log(b*x + a)/b^2 - 1
/2*(2*B*c*d*g*n - B*c^2*h*n)*log(-d*x - c)/d^2